const http = require('http')
const fs = require('fs')
const app = http.createServer((request,response)=>{
    console.log(request.url);
    let url = __dirname + request.url
    console.log(url);
    // if (request.url === '\favicon.ico') {
    //     response.end('404')
    //     return
    // }
    fs.readFile(url,(err,data)=>{
        console.log(data);
        if (err) {
            console.log(err);
        } else {
            response.end(data)
        }
    })
})
app.listen(80,()=>{
    console.log('80端口启动成功');
})